package com.roy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.roy.mapper.UserMapper;
import com.roy.model.User;
import com.roy.service.UserService;

@Service(value = "userService")
public class UserServiceImpl implements UserService{
	
	@Autowired
	private UserMapper userMapper;//这里会报错，但是并不会影响

	@Override
	public int addUser(User user) {
		// TODO Auto-generated method stub
		return userMapper.insert(user);
	}

	@Override
	public List<User> findAllUser(int pageNum, int pageSize) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, pageSize);
		return userMapper.selectAllUser();
	}

}
